package cool.mtc.minghe.data.model.websocket.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Objects;

/**
 * @author 明河
 */
@Schema(description = "WebSocket在线用户信息")
@Data
public class WebSocketOnlineUserDTO {

    private String id;
    private String sessionId;
    private String name;

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        WebSocketOnlineUserDTO that = (WebSocketOnlineUserDTO) obj;
        return Objects.equals(sessionId, that.sessionId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(sessionId);
    }
}
